package com.supermap.rootstock.data.source;

import com.supermap.rootstock.common.core.utils.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author aqua
 * @description
 * @date 2019年09月25 17:05
 * @email 1301584033@qq.com
 */
@RestController
@RequestMapping("/source")
@AllArgsConstructor
public class SourceConfigController {
	private final  SourceConfigService sourceConfigService;


	@GetMapping("/getDataBase")
	@ResponseBody
	public R getDataBase(){

		return  sourceConfigService.getDataBase();
	}


	@GetMapping("/getDatatSourceConfig")
	@ResponseBody
	public R getDatatSourceConfig(Integer userId){
		return  sourceConfigService.getDatatSourceConfig(userId);
	}

	@PutMapping("/puttDatatSourceConfig")
	@ResponseBody
	public R puttDatatSourceConfig(@RequestBody DataSource dataSource) {
		return sourceConfigService.puttDatatSourceConfig(dataSource);
	}
	@DeleteMapping("/delDatatSourceConfig")
	@ResponseBody
	public R delDatatSourceConfig(Integer id){
		return sourceConfigService.delDatatSourceConfig(id);
	}
}
